<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<jsp:include page="/store/common/head.jsp">
	<jsp:param name="title" value="分配骑手"/>
</jsp:include>
<style>
.layui-laydate-content>.layui-laydate-list {
    padding-bottom: 0px;
    overflow: hidden;
}
.layui-laydate-content>.layui-laydate-list>li{
    width:50%
}

.merge-box .scrollbox .merge-list {
    padding-bottom: 5px;
}
.layui-laydate-content>.layui-laydate-list>li:nth-child(2)>ol>li:nth-child(-n+30):nth-child(n+2){
    display: none;
} 
.layui-laydate-content>.layui-laydate-list>li:nth-child(2)>ol>li:nth-child(-n+60):nth-child(n+32){
    display: none;
} 

</style>
<script>
wm.load.synchronizesLoadJs('/wangge/order/getQishouJs.json?token='+wm.token.get());
</script>
<form  class="layui-form" action="" style="padding:20px; padding-top:35px; margin-bottom: 10px;">
	<input type="hidden" name="id" value="${order.id }">
	<div class="layui-form-item">
		<label class="layui-form-label">分配骑手</label>
		<div class="layui-input-block">
			<script type="text/javascript">writeSelectAllOptionForqishou_id_('${order.qishouId }','请选择', 1);</script>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">转单理由</label>
		<div class="layui-input-block">
		<textarea style="height:150px;width:385px" name="reason" class="layui-input" value="${reason }"></textarea><br>
		</div>
	</div>
	<div class="layui-form-item" style="padding-top:15px;">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="demo">保存</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>
<script>
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form;
	//监听提交
	form.on('submit(demo)', function(data){
		parent.parent.msg.loading("保存中");
		var postDate = wm.getJsonObjectByForm($("form"));	//提交的表单数据
		wm.post('/wangge/order/transfer.json', postDate, function (obj) { 
			parent.parent.msg.close();
			checkLogin(data);	//验证登录状态。如果未登录，那么跳转到登录页面
			if(obj.result == '1'){
				parent.parent.msg.success("操作成功")
				parent.layer.close(index);
				parent.location.reload();	//刷新父窗口
			}else if(obj.result == '0'){
				parent.parent.msg.failure(obj.info);
			}else{
				parent.parent.msg.failure(result);
			}
		});
		return false;
	});
});
//当前网址get传入的参数
var id = wm.getUrlParams('id');	
if(id != null && id.length > 0 && id != '0'){
	//get传入要修改id了，那就加载要修改的这项的数据
	msg.loading('加载中');
	wm.post('/wangge/order/orderDetails.json?id='+id,{},function(data){
		msg.close();		//关闭“加载中”的等待提示
		checkLogin(data);	//验证登录状态。如果未登录，那么跳转到登录页面
		if(data.result == '1'){
			//获取数据成功
			//将接口获取到的数据自动填充到 form 表单中
			wm.fillFormValues($('form'), data.order);
		}else{
			//接口返回失败，弹出失败提示
			msg.failure(data.info);
		}
	});
}
</script>
<jsp:include page="/wm/common/foot.jsp"></jsp:include>